<template>
  <div class="header">
    我是头部
    <br>
    <span>父组件传参到子组件， withDefaults</span>
    {{ title }}
    <div v-for="item in nums" :key="item">
      {{ item }}
    </div>
  </div>
</template>

<script lang="ts" setup>
type props = {
  title?: string
  nums?: number[]
}
withDefaults(defineProps<props>(), {
  title: "我是标题默认值",
  nums: () => [1, 1, 1]
})

</script>

<style lang="less" scoped>
.header {
  height: 10%;
  border-bottom: 1px solid #ccc;
}
</style>